<template>
	<view style="min-height: 100vh;display: inline-block;width: 750rpx;background: #F1F1F1;">
		<view class="top">

			<view class="info">
				<view class="u-flex u-padding-40">
					<u-image :src="user.headimg" width="120" height="120" shape="circle"></u-image>
					<view class="u-margin-left-20">
						<view class="" v-if="user.nickname">
							<view style="color: #FFFFFF;font-size: 34rpx;">{{user.nickname}}</view>
							<view class="vip">会员等级：{{user.vipId}}</view>

						</view>
						<view v-else style="font-size: 34rpx;color: #fff;">
						
								点击登陆
							
						</view>
					</view>
				</view>
			</view>
		</view>


		<view v-if="user">
			<view class="block">
				<u-cell-item :border-bottom="false" title="我的订单" @click="$Go('/pages/user/book')">
					<image src="/static/useIcon_1.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>

			<view class="block">
				<u-cell-item :border-bottom="false" title="会员到期时间" :value="user.end">
					<image src="/static/useIcon_2.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>
			
			
			<view class="block" v-if="user.vvipEnd">
				<u-cell-item :border-bottom="false" title="教学视频会员到期时间" :value="user.vvipEnd">
					<image src="/static/useIcon_2.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>

			<view class="block">
				<u-cell-item :border-bottom="false" title="客服热线"  :value="info.kfTel">
					<image src="/static/useIcon_3.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>

			<view class="block">
				<u-cell-item :border-bottom="false" title="微信客服" :value="info.kfWx">
					<image src="/static/useIcon_4.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>

			<view class="block">

				<u-cell-item :border-bottom="false" title="关于我们" @click="$Go('/pages/parse/index?id=15')">
					<image src="/static/useIcon_5.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>

			<view class="block">
				<u-cell-item :border-bottom="false" title="留言反馈" @click="$Go('/pages/user/feedback')">
					<image src="/static/useIcon_6.png" class="icon" slot="icon"></image>
				</u-cell-item>
			</view>





		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				user: {},
				info:{}
			}
		},
		onLoad() {
			this.$u.post('/user/information', {}).then(res => {
				this.user = res;
			}).catch(err => {

			})
			this.getConfig()
		},
		methods: {
          getConfig(){
			  this.$u.post('/index/getConfig',).then(res => {
			  	this.info = res;
			  }).catch(err => {
			  
			  })
			  
		  }
		}
	}
</script>

<style>
	.top {
		width: 750rpx;

		background: linear-gradient(180deg, #3CB4FE 0%, #328DFB 100%);
	}

	.vip {
		padding: 10rpx;
		background: #FFFADC;
		border-radius: 100rpx;
		text-align: center;
		color: #FFB103;
		line-height: 40rpxFFB103;
		margin-top: 20rpx;
		font-size: 20rpx;
	}

	.icon {
		width: 48rpx;
		height: 48rpx;
		margin-right: 20rpx;
	}

	.block {
		background: #fff;
		margin-top: 20rpx;
		width: 700rpx;
		margin:30rpx auto;
		border-radius: 10rpx;
	}
</style>
